import React from 'react'
import '../css/home.css'
import Event from '../index/Event'


class Home extends React.Component{
    constructor(props){
      super();
      this.state={
        list:[]
      }
  
    }
  
    render(){
      return(
        <div className="ssd">
          <input  type="text" ref="textd"  onKeyDown={(e)=>{
            if(e.keyCode==13){
              var text=this.refs.textd.value

              let todo={
                name:text,
                fel:false
              }

              Event.emit('add',todo)


              this.refs.textd.value=''

            }
          }} placeholder="请输入你的任务名称,按回车键确认" className="input"/>
            
          
        </div>
      )
    }
  
    
  
  
  
  
  }
  
  export default Home;